import { Injectable } from '@nestjs/common';
import { generateResponse, GenerateResponseParams } from '@/utils/response';
import { GlobalRsaKeyPairService } from '@/modules/global-module/rsa-key-pair/service';

@Injectable()
export class CommonService {
  constructor(private readonly globalRsaKeyPairService: GlobalRsaKeyPairService) {}

  getPublicKey(): GenerateResponseParams<{ publicKey: string }> {
    return generateResponse({
      data: {
        publicKey: this.globalRsaKeyPairService.getRsaPublicKey(),
      },
    });
  }
}
